<?php
$smarty->configLoad($lang . '/creport.module.php');
$language = parse_ini_file($lang . '/breadcrumb.module.php', true);
$breadcrumb = $language['creport'];

if(isset($_POST['submit'])) {
	$user = new user;
	$userID = $user->getID($_POST['username']);
	$sql = 'INSERT INTO '.DB_CMS.'.module_creport (userID, reason, timestamp, stars) VALUES (:userID, :reason, CURRENT_TIMESTAMP, :stars) ';
	$dbh = $connection->prepare($sql);
	$dbh->bindValue(':userID', $userID);
	$dbh->bindValue(':reason', $_POST['reason']);
	$dbh->bindValue(':stars', $_POST['stars']);
	$dbh->execute();
	$main->jqmodal('addet');
	echo '<meta http-equiv="refresh" content="5; URL=index.php?mod=creport">';

}
$template = 'creport/add.tpl';
?>
 